package com.hcinfos.gsoo.json;

import org.codehaus.jackson.type.TypeReference;
import org.json.JSONObject;

import com.hcinfos.gsoo.enity.Version;

public class VersionJson extends BaseJson {

	public static int totalNums = 0;
	public static int state = 0;

	public static Version getVersionByJson(String result) throws Exception {

		JSONObject obj = new JSONObject(result);
		String arrayStr = obj.getString("data");
		if (!obj.isNull("state")) {
			state = obj.getInt("state");
		}
		Version version = objectMapper.readValue(arrayStr,
				new TypeReference<Version>() {
				});
		return version;
	}
}
